<template>
  <div class="home">
  </div>
  <div>
    <div>{{count}}</div>
    <button @click="add">点击</button>
  </div>
</template>

<script>
  // @ is an alias to /src
  import {ref} from 'vue';
  function increase() {
    const count = ref(0);
    const add = () => {
      count.value++;
    }
    return {
      count, add
    }
  }

  export default {
    name: 'Home',
    components: {},
    setup() {
      let {count, add} = increase();

      return {count, add};
    }
  }
</script>
